import * as React from 'react'
import { render } from '../../renderer/index.js'

function Index() {
  const [state, setSatate] = React.useState(1)

  return (
    <view>
      <button onTap={() => setSatate(state => state + 1)}>increase {state}</button>
    </view>
  )
}

Page({
  data: {
    vdom: null,
  },
  onLoad() {
    render(<Index />, {
      mounted: (vdom) => this.setData({ vdom }),
      updated: (vdom) => this.setData({ vdom }),
    })
  },
})
